<template>
  <el-dialog
    v-model="info.isShow"
    :title="info.isAdd ? '添加菜单管理' : '编辑菜单管理'"
    center
    :before-close="cancel"
  >
    <!-- <el-form :model="form">
      <el-form-item label="Promotion name" :label-width="formLabelWidth">
        <el-input v-model="form.name" autocomplete="off" />
      </el-form-item>
      <el-form-item label="Zones" :label-width="formLabelWidth">
        <el-select v-model="form.region" placeholder="Please select a zone">
          <el-option label="Zone No.1" value="shanghai" />
          <el-option label="Zone No.2" value="beijing" />
        </el-select>
      </el-form-item>
    </el-form> -->
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="cancel">取消</el-button>
        <el-button type="primary" @click="sure">确定</el-button>
      </span>
    </template>
  </el-dialog>
</template>
  
  <script setup>
import { defineProps, defineEmits } from "vue";
//-----接收来自父组件的数据-------------
let info1 = defineProps(["info"]);

//-----------------定义方法-----------
//1.子传父，取消 ，关闭弹窗
let emit = defineEmits("cancel");
function cancel() {
  emit("cancel");
}

//2.确定---添加、编辑
function sure() {
  if (info1.info.isAdd) {
    console.log("添加");
  } else {
    console.log("编辑");
  }
  cancel();
}
</script>
  
  <style>
</style>